home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 165 / XENIATGM165.ISO / cddata / main.dxr / 00008_DirectMedia Xtra Controller Button.ls < prev    next >
Encoding:
Text File  |  2003-05-29  |  3.5 KB  |  64 lines

  1. property videoSprite, VideoCommand, standardImage, alternateImage, clickedImage, param1, param2
  2.  
  3. on DoControl me
  4.   case me.VideoCommand of
  5.     #play:
  6.       videoseek(sprite(me.videoSprite), sprite(me.videoSprite).segmentstart)
  7.       videoplay(sprite(me.videoSprite))
  8.     #pause:
  9.       videopause(sprite(me.videoSprite))
  10.     #rewind:
  11.       videoseek(sprite(me.videoSprite), sprite(me.videoSprite).segmentstart)
  12.     #StepForward:
  13.       videopause(sprite(me.videoSprite))
  14.       videoseek(sprite(me.videoSprite), sprite(me.videoSprite).currentTime + 30)
  15.     #StepBackward:
  16.       videopause(sprite(me.videoSprite))
  17.       videoseek(sprite(me.videoSprite), sprite(me.videoSprite).currentTime - 30)
  18.     #Seek:
  19.       videoseek(sprite(me.videoSprite), me.param1)
  20.     #playsegment:
  21.       videoplaysegment(sprite(me.videoSprite), me.param1, me.param2)
  22.   end case
  23. end
  24.  
  25. on mouseUp me
  26.   set the member of sprite the spriteNum of me to me.standardImage
  27.   DoControl(me)
  28. end
  29.  
  30. on mouseDown me
  31.   set the member of sprite the spriteNum of me to me.clickedImage
  32. end
  33.  
  34. on mouseEnter me
  35.   set the member of sprite the spriteNum of me to me.alternateImage
  36. end
  37.  
  38. on mouseLeave me
  39.   set the member of sprite the spriteNum of me to me.standardImage
  40. end
  41.  
  42. on beginSprite me
  43.   me.standardImage = the member of sprite me.spriteNum
  44. end
  45.  
  46. on getPropertyDescriptionList
  47.   if the currentSpriteNum = 0 then
  48.     memdefault = 0
  49.   else
  50.     memref = the member of sprite the currentSpriteNum
  51.     castLibNum = memref.castLibNum
  52.     mb = member(memref).memberNum + 1
  53.     mb2 = member(memref).memberNum + 2
  54.     memdefault = member(mb, castLibNum)
  55.     memdefault2 = member(mb2, castLibNum)
  56.   end if
  57.   p_list = [#VideoCommand: [#comment: "Action:", #format: #symbol, #range: [#play, #pause, #rewind, #StepBackward, #StepForward, #Seek, #playsegment], #default: #play], #param1: [#comment: "First Parameter (Use with seek or playsegment):", #format: #long, #default: 0], #param2: [#comment: "Second Parameter (Use with playsegment):", #format: #long, #default: 0], #videoSprite: [#comment: "DirectMedia Sprite Channel:", #format: #integer, #default: 1], #alternateImage: [#comment: "Rollover Button Cast Member:", #format: #graphic, #default: memdefault], #clickedImage: [#comment: "Clicked Button Cast Member:", #format: #graphic, #default: memdefault2]]
  58.   return p_list
  59. end
  60.  
  61. on getBehaviorDescription
  62.   return "Used to create Play, Pause, StepForward, StepBackward, Rewind, Seek and PlaySegment control buttons for a DirectMedia Xtra video sprite. You can also attach rollover and alternate images for the clicked buttons" & RETURN & "PARAMETERS:" & RETURN & "Action - Choose the action to perform on mouseUP ( Play, Pause, Rewind, StepBackward, StepForward, Seek, PlaySegment )." & RETURN & "First Parameter: if the Action is Seek than this parameter contains the seek to time (in milliseconds). For the PlaySegment action this parameter contains the starting time of the segment to play (in milliseconds)" & RETURN & "Second Parameter: Used with the PlaySegment action. Contains the ending time of the segment to play (in milliseconds)" & RETURN & "DirectMedia Sprite Channel - Enter the number of sprite channel of the DirectMedia Xtra video that is being controlled." & RETURN & "Rollover Button: the castmember that will be used as the rollover image of the button. Default is the castmember located just after the button castmember" & RETURN & "Clicked Button: the castmember that will be used as the clicked image of the button. Default is the castmember located just after the rollover castmember"
  63. end
  64.